<template>
  <div class="params">
    <div class="header">
      <el-input
        @change="searchainp"
        v-model="input"
        placeholder="请输入内容"
      ></el-input>
      <el-button type="primary">查询</el-button>
      <el-button type="primary">添加</el-button>
    </div>
    
    <div class="content">
      <el-table :border="true" :data="tableData" style="width: 100%">
        <el-table-column type="selection" prop="date" borde width="40px">
        </el-table-column>
        <el-table-column prop="id" label="编号" width="80px"> </el-table-column>
        <el-table-column prop="title" label="title" width="80px">
        </el-table-column>
        <el-table-column prop="num" label="姓名" width="80px">
        </el-table-column>
        <el-table-column prop="category" label="姓名" width="80px">
        </el-table-column>
        <el-table-column prop="name" label="姓名" width="80px">
        </el-table-column>
        <el-table-column prop="name" label="姓名" width="80px">
        </el-table-column>
        <el-table-column prop="address" label="地址"> </el-table-column>
      </el-table>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      input: "",
      tableData: [],
    };
  },
  methods:{
searchainp(val){
  // console.log('nihao',val);
  this.$api.getsearch({search:val}).then(res=>{
    if(status==200){
      this.tableData = res.data.result
      
    }else{
        this.tableData = []
    }
  })
  
}
  },

   created() {
    this.$api.getgooList({ params: 1 }).then((res) => {
      console.log("res.data", res.data);
      if ((status = 200)) {
        this.tableData = res.data.data;
      }
    });
  },
};
</script>

<style lang="less" scoped>
.params {
  // display: flex;
  margin: 20px;
  // box-sizing: border-box;
  .header {
    display: flex;
    .el-button {
      margin-left: 10px;
    }
  }
  .content {
    height: 800px;
    width: 100%;
    background-color: rgb(252, 254, 255);
    // margin: 20px 20px;
    margin-top: 20px;
  }
}
</style>